'===============================================================================
' IndiaStockQuotes Component Sample Application.
' Author : Hemant Kamalakar
' Email  : hemant.kamalakar@gmail.com
'===============================================================================
Imports System
Imports System.Text
Imports System.Collections.Generic
Imports System.Drawing
Imports DotnetIndia.StockQuotes.NSE
Imports DotnetIndia.StockQuotes
Public Class frmStockChartTest
    'Get the Stock Chart for the Symbol from NSE
    Public Sub GetStockChart(ByVal stockSymbol As String)
        Dim StockRateProvider As New Yahoo.StockQuotes
        Dim IncomingData As Image
        IncomingData = StockRateProvider.GetStockCharts(stockSymbol, ChartDurationType.OneDay)
        IncomingData.Save("test.png", Imaging.ImageFormat.Png)
        picChart.Load("test.png")
    End Sub
    Private Sub btnGetStockChart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGetStockChart.Click
        GetStockChart(txtSymbol.Text.Trim)
    End Sub

    Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click
        Me.Close()
    End Sub
End Class